<?php

/**
 * @file
 * Customize the header information shown when editing or viewing submissions.
 *
 * Available variables:
 * - $node: The node object for this webform.
 * - $mode: Either "form" or "display". May be other modes provided by other
 *          modules, such as "print" or "pdf".
 * - $submission: The contents of the webform submission.
 * - $account: The user that submitted the form.
 */
$initiation_result = webform_get_initiation_title($node->nid);
?>
<fieldset class="webform-submission-info clearfix">
  <div><h2><font color="#333"><?php print t('Submission information'); ?></font></h2></div>
  <?php print theme('user_picture', array('account' => $account)); ?>
  <div class="webform-submission-info-text">
    <?php if(isset($initiation_result['if_initiation']) && $initiation_result['if_initiation'] ): ?>
      <div><?php print t('Form: !form', array('!form' => l($initiation_result['initiation_title'], 'node/' . $node->nid, $submission->url_query ))); ?></div>
    <?php else: ?>
      <div><?php print t('Form: !form', array('!form' => l($node->title, 'node/' . $node->nid))); ?></div>
    <?php endif; ?>
    <div><?php print t('Submitted by: !name', array('!name' => theme('username', array('account' => $account)))); ?></div>
    <div><?php print format_date($submission->submitted, 'large'); ?></div>
    <div><?php print $submission->remote_addr; ?></div>
    <div>
        <?php print t('Enquiry Number:');
        $enquiry=get_enquiry_by_sid($submission->sid);
        print $enquiry['enquiry_number'];
        
        ?>
    </div>
  </div>
</fieldset>
